package o;

import android.content.Context;
import com.huawei.hianalytics.util.HiAnalyticTools;
import com.huawei.hianalytics.v2.HiAnalytics;
import com.huawei.hianalytics.v2.HiAnalyticsConf.Builder;
import com.huawei.hms.utils.HMSBIInit;

public class dqo {

    static class c implements o.dqq.c {
        private c() {
        }

        public void ˏ(String str) {
            if (dof.ˋ(str)) {
                Logger.e("AnalyticsStragtegy", "url is blank.");
                return;
            }
            Context ˋ = ContentManager.getInstant().getContext();
            if (Logger.ˎ()) {
                HiAnalyticTools.enableLog(ˋ);
            }
            Builder builder = new Builder(ˋ);
            builder.setCollectURL(0, str);
            builder.setCollectURL(1, str);
            o.bjy.c ॱ = new bjy(ContentManager.getInstant().getContext()).ॱ();
            if (ॱ.ॱ == 0) {
                builder.setIMEI(ॱ.ˎ);
            } else if (ॱ.ॱ == 9) {
                builder.setUDID(ॱ.ˎ);
            }
            HMSBIInit hMSBIInit = new HMSBIInit();
            if (hMSBIInit.isInit()) {
                hMSBIInit.refresh(ˋ, false, false, false, str, true);
            } else {
                hMSBIInit.init(ˋ, false, false, false, str);
            }
            if (HiAnalytics.getInitFlag()) {
                builder.refresh(true);
            } else {
                builder.create();
            }
        }
    }

    public void ˎ(dqq o_dqq) {
        if (diu.ˊ().ˎ()) {
            Logger.ˎ("AnalyticsStragtegy", "config().");
            o_dqq.ˏ(new c());
            return;
        }
        Logger.ˋ("AnalyticsStragtegy", "not agree protocol.");
    }
}
